/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package persistencia;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author euzinha
 */
@Entity
@Table(name = "DISCIPLINAS")
@NamedQueries({
    @NamedQuery(name = "Disciplinas.findAll", query = "SELECT d FROM Disciplinas d")})
public class Disciplinas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Column(name = "NOME")
    private String nome;
    @Column(name = "SERIE")
    private Integer serie;
    @JoinColumn(name = "CURSOS_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Cursos cursosId;
    @JoinColumn(name = "CURSOS_ID", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Cursos cursosId1;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "disciplinasId")
    private Collection<Matricula> matriculaCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "disciplinasId1")
    private Collection<Matricula> matriculaCollection1;

    public Disciplinas() {
    }

    public Disciplinas(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public Integer getSerie() {
        return serie;
    }

    public void setSerie(Integer serie) {
        this.serie = serie;
    }

    public Cursos getCursosId() {
        return cursosId;
    }

    public void setCursosId(Cursos cursosId) {
        this.cursosId = cursosId;
    }

    public Cursos getCursosId1() {
        return cursosId1;
    }

    public void setCursosId1(Cursos cursosId1) {
        this.cursosId1 = cursosId1;
    }

    public Collection<Matricula> getMatriculaCollection() {
        return matriculaCollection;
    }

    public void setMatriculaCollection(Collection<Matricula> matriculaCollection) {
        this.matriculaCollection = matriculaCollection;
    }

    public Collection<Matricula> getMatriculaCollection1() {
        return matriculaCollection1;
    }

    public void setMatriculaCollection1(Collection<Matricula> matriculaCollection1) {
        this.matriculaCollection1 = matriculaCollection1;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Disciplinas)) {
            return false;
        }
        Disciplinas other = (Disciplinas) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "persistencia.Disciplinas[id=" + id + "]";
    }

}
